﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YServer;

namespace ServerApp
{
    public abstract class AbsMutiplitySendHandler:AbsOnceSendHandler
    {

        public void Broadcast(List<YToken> tokens, int command)
        {
            Broadcast(tokens, GetArea(), command);
        }
        public void Broadcast(List<YToken> tokens, int area, int command)
        {
            Broadcast(tokens, GetProType(), area, command);
        }
        public void Broadcast(List<YToken> tokens, byte type, int area, int command)
        {
            Broadcast(tokens, type, area, command, null);
        }
        public void Broadcast(List<YToken> tokens, byte type, int area, int command, object transModel)
        {
            SocketModel model = new SocketModel(type, area, command, transModel);
            Broadcast(tokens, model);
        }


        public void Broadcast(List<YToken> tokens,SocketModel model) {
            foreach (YToken item in tokens)
            {
                Send(item, model);
            }
        }
    }
}
